//--- OBJECT WRITE BEGIN ---

function loadStartup()
{
	$StartupIdx=0;
	StartupGui::next();
   schedule(100, 0, checkStartupDone );
   alxPlay(menumusic);
}

//-------------------------------------
function StartupGui::click()
{
	StartupGui.done=true;
   checkStartupDone();
}

//-------------------------------------
function StartupGui::next()
{
	Canvas.setContent( BlankGui );
		
	$StartupIdx++;
	
	%bitmap[1] = "GarageGames.jpg";
	%bitmap[2] = "torque.jpg";
	%bitmap[3] = "MentalMachine.jpg";

    StartupGui.setBitmap("starter.racing/client/ui/" @ %bitmap[$StartupIdx]);
	StartupGui.done=false;
	Canvas.setContent( StartupGui );

}

//-------------------------------------
function checkStartupDone()
{
   if (!isObject(StartupGui))
      return;
      
   if (StartupGui.done)
		if ($StartupIdx==3)
		{
         StartupGui.done=1;
         StartupGui.delete();
         BlankGui.delete();
         flushTextureCache(); // dont wanna keep the startup logos in vram
         loadMainMenu();
         alxstop(menumusic);
		} else {			
			StartupGui::next();
			schedule(100, 0, checkStartupDone );
		}
   else
      schedule(100, 0, checkStartupDone );
}

//--- OBJECT WRITE END ---
